var express = require('express');
var router = express.Router();
const {getUsers,addUsers,updateUsers,deleteUsersById,getUsersById}=require('../service/usersService')
/* GET users listing. */
router.get('/getUsers',async function(req, res, next) {
  const data=await getUsers(req.query);
  res.send(data);
});
router.get('/getUsersById',async function(req, res, next) {
  const data=await getUsersById(req.query);
  res.send(data);
});
router.post('/addUsers',async function(req, res, next) {
  const data=await addUsers(req.body);
  res.send(data);
});
router.post('/updateUsers',async function(req, res, next) {
  const data=await updateUsers(req.body);
  res.send(data);
});
router.post('/deleteUsersById',async function(req, res, next) {
  const data=await deleteUsersById(req.body);
  res.send(data);
});

module.exports = router;
